# Maintainer: Thore Bödecker <foxxx0@archlinux.org>

_gemname=stomp
pkgname="ruby-${_gemname}"
pkgver=1.4.10
pkgrel=2
pkgdesc='Ruby client for the Stomp messaging protocol'
url='https://github.com/stompgem/stomp'
arch=('any')
license=('Apache')
depends=('ruby')
makedepends=('ruby-rake' 'ruby-rspec' 'ruby-bundler' 'ruby-rdoc' 'ruby-test-unit')
options=('!emptydirs')
source=("${_gemname}-v${pkgver}.tar.gz::${url}/archive/v${pkgver}.tar.gz")
sha512sums=('46a70a191dfe06179972765318fa26327d0047ebc02e17788791f9f28c3060ff64a30d6aa5a8805020dbacf5c76037235ed22a4e3f963bbcae166ad1711ecc0c')

prepare() {
  cd "${srcdir}/${_gemname}-${pkgver}"
  :
}

build() {
  cd "${srcdir}/${_gemname}-${pkgver}"
  mkdir -p pkg
  gem build -o "pkg/${_gemname}-${pkgver}.gem"
}

check() {
  cd "${srcdir}/${_gemname}-${pkgver}"
  # testsuite is broken and needs older versions of rspec / rspec-mocks
  #rake test
}

package() {
  cd "${srcdir}/${_gemname}-${pkgver}"
  local _gemdir="$(gem env gemdir)"

  gem install \
    --verbose \
    --ignore-dependencies \
    --no-user-install \
    --install-dir "${pkgdir}/${_gemdir}" \
    --bindir "${pkgdir}/usr/bin" \
    "pkg/${_gemname}-${pkgver}.gem"

  rm -rf "${pkgdir}/${_gemdir}/cache"

  install -D -m644 "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

# vim: ts=2 sw=2 et:
